package com.inspectortime.webapp;

import org.springframework.validation.Errors;
import org.springframework.validation.ValidationUtils;
import org.springframework.validation.Validator;

import com.mkode.util.java.lang.ClassUtils;

/**
 * @author mkvalsvik
 * 
 */
public class FindInspectorByZipFormValidator implements Validator {

	public boolean supports(Class clazz) {
		return ClassUtils.isInstanceOf(clazz, FindInspectorByZipForm.class);
	}

	public void validate(Object obj, Errors errors) {
		ValidationUtils.rejectIfEmpty(errors, "zipCode",
				"required");
	}

}
